package cn.jc.spider.neww.storer;

import java.util.List;
import java.util.Map;

import org.apache.commons.collections.CollectionUtils;
import org.apache.torque.TorqueException;
import org.apache.torque.util.Criteria;

import cn.jc.spider.po.DataDoubanCity;
import cn.jc.spider.po.DataDoubanCityPeer;


/**
 * 豆瓣影院城市
 * 
 * @author JiangChi
 *
 */
public class StorerDoubanCityImpl extends StorerImpl {
	@Override
	public void saveOneObject(Map<String, Object> m) {
		Criteria cccc = buildCriteria(DataDoubanCityPeer.TABLE_NAME, m);
		try {
			Criteria ccc = new Criteria();
			ccc.add(DataDoubanCityPeer.UID, m.get("uid"));
			List<DataDoubanCity> dxs = DataDoubanCityPeer.doSelect(ccc);
			if (CollectionUtils.isEmpty(dxs)) {
				DataDoubanCityPeer.doInsert(cccc);
			} else {
//				timetime++;//有的地方可能有需求统计有重复数据的次数
			}
		} catch (TorqueException e) {
			e.printStackTrace();
		}
	}

}
